home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 April: Mac OS SDK / Dev.CD Apr 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / AIncludes / JManager.a < prev    next >
Encoding:
Text File  |  1998-08-17  |  29.4 KB  |  949 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        JManager.a
  3. ;
  4. ;    Contains:    Routines that can be used to invoke the Java Virtual Machine in MRJ 
  5. ;
  6. ;    Version:    Technology:    MRJ 2.1
  7. ;                Release:    Universal Interfaces 3.2
  8. ;
  9. ;    Copyright:    © 1996-1998 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__JMANAGER__') = 'UNDEFINED' THEN
  18. __JMANAGER__ SET 1
  19.  
  20.     IF &TYPE('__CONDITIONALMACROS__') = 'UNDEFINED' THEN
  21.     include 'ConditionalMacros.a'
  22.     ENDIF
  23.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  24.     include 'MacTypes.a'
  25.     ENDIF
  26.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  27.     include 'Files.a'
  28.     ENDIF
  29.     IF &TYPE('__DRAG__') = 'UNDEFINED' THEN
  30.     include 'Drag.a'
  31.     ENDIF
  32.     IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
  33.     include 'Quickdraw.a'
  34.     ENDIF
  35.     IF &TYPE('__MENUS__') = 'UNDEFINED' THEN
  36.     include 'Menus.a'
  37.     ENDIF
  38.     IF &TYPE('__TEXTCOMMON__') = 'UNDEFINED' THEN
  39.     include 'TextCommon.a'
  40.     ENDIF
  41.  
  42.  
  43.  
  44. kJMVersion                        EQU        $11000003            ; using Sun's 1.1 APIs, our current APIs. 
  45. kDefaultJMTime                    EQU        $00000400            ; how much time to give the JM library on "empty" events, in milliseconds. 
  46.  
  47. kJMVersionError                    EQU        -60000
  48. kJMExceptionOccurred            EQU        -60001
  49. kJMBadClassPathError            EQU        -60002
  50. ; *    Private data structures
  51. ; *
  52. ; *    JMClientData        - enough bits to reliably store a pointer to arbitrary, client-specific data. 
  53. ; *    JMSessionRef        - references the entire java runtime 
  54. ; *    JMTextRef            - a Text string, length, and encoding 
  55. ; *    JMTextEncoding        - which encoding to use when converting in and out of Java strings.
  56. ; *    JMFrameRef            - a java frame 
  57. ; *    JMAWTContextRef     - a context for the AWT to request frames, process events 
  58. ; *    JMAppletLocatorRef    - a device for locating, fetching, and parsing URLs that may contain applets 
  59. ; *    JMAppletViewerRef    - an object that displays applets in a Frame 
  60.  
  61. ; typedef void *                        JMClientData
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75. ; typedef TextEncoding                     JMTextEncoding
  76.  
  77.  
  78. ; * The runtime requires certain callbacks be used to communicate between
  79. ; * session events and the embedding application.
  80. ; *
  81. ; * In general, you can pass nil as a callback and a "good" default will be used.
  82. ; *
  83. ; *    JMConsoleProcPtr          - redirect stderr or stdout - the message is delivered in the encoding specified when
  84. ; *                                you created the session, or possibly binary data.
  85. ; *    JMConsoleReadProcPtr     - take input from the user from a console or file.  The input is expected to 
  86. ; *                                be in the encoding specified when you opened the session.
  87. ; *    JMExitProcPtr              - called via System.exit(int), return "true" to kill the current thread,
  88. ; *                                false, to cause a 'QUIT' AppleEvent to be sent to the current process,
  89. ; *                                or just tear down the runtime and exit to shell immediately
  90. ; * JMLowMemoryProcPtr          - This callback is available to notify the embedding application that
  91. ; *                                a low memory situation has occurred so it can attempt to recover appropriately.
  92. ; * JMAuthenicateURLProcPtr  - prompt the user for autentication based on the URL.  If you pass
  93. ; *                                nil, JManager will prompt the user.  Return false if the user pressed cancel.
  94.  
  95. JMSessionCallbacks        RECORD 0
  96. fVersion                 ds.l    1                ; offset: $0 (0)        ;  should be set to kJMVersion 
  97. fStandardOutput             ds.l    1                ; offset: $4 (4)        ;  JM will route "stdout" to this function. 
  98. fStandardError             ds.l    1                ; offset: $8 (8)        ;  JM will route "stderr" to this function. 
  99. fStandardIn                 ds.l    1                ; offset: $C (12)        ;  read from console - can be nil for default behavior (no console IO) 
  100. fExitProc                 ds.l    1                ; offset: $10 (16)        ;  handle System.exit(int) requests 
  101. fAuthenticateProc         ds.l    1                ; offset: $14 (20)        ;  present basic authentication dialog 
  102. fLowMemProc                 ds.l    1                ; offset: $18 (24)        ;  Low Memory notification Proc 
  103. sizeof                     EQU *                    ; size:   $1C (28)
  104.                         ENDR
  105.  
  106. ; typedef long                            JMVerifierOptions
  107. eDontCheckCode                    EQU        0
  108. eCheckRemoteCode                EQU        1
  109. eCheckAllCode                    EQU        2
  110.  
  111. ; * JMRuntimeOptions is a mask that allows you to specify certain attributes
  112. ; * for the runtime. Bitwise or the fields together, or use one of the "premade" entries.
  113. ; * eJManager2Defaults is the factory default, and best bet to use.
  114.  
  115.  
  116. ; typedef long                            JMRuntimeOptions
  117. eJManager2Defaults                EQU        0
  118. eUseAppHeapOnly                    EQU        $01
  119. eDisableJITC                    EQU        $02
  120. eEnableDebugger                    EQU        $04
  121. eDisableInternetConfig            EQU        $08
  122. eInhibitClassUnloading            EQU        $10
  123. eEnableProfiling                EQU        $20
  124. eJManager1Compatible            EQU        $18
  125.  
  126.  
  127.  
  128. ; * Returns the version of the currently installed JManager library.
  129. ; * Compare to kJMVersion.  This is the only call that doesn't
  130. ; * require a session, or a reference to something that references
  131. ; * a session.
  132.  
  133. ;
  134. ; extern unsigned long JMGetVersion(void)
  135. ;
  136.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  137.         IMPORT_CFM_FUNCTION JMGetVersion
  138.     ENDIF
  139.  
  140. ; * JMOpenSession creates a new Java Runtime.  Note that JManger 2.0 doesn't set 
  141. ; * security options at the time of runtime instantiation.  AppletViewer Objecs have
  142. ; * seperate security attributes bound to them, and the verifier is availiable elsewhere
  143. ; * as well.  The client data parameter lets a client associate an arbitgrary tagged pointer
  144. ; * with the seession.
  145. ; * When you create the session, you must specify the desired Text Encoding to use for
  146. ; * console IO.  Usually, its OK to use "kTextEncodingMacRoman".  See TextCommon.h for the list.
  147.  
  148. ;
  149. ; extern OSStatus JMOpenSession(JMSessionRef *session, JMRuntimeOptions runtimeOptions, JMVerifierOptions verifyMode, const JMSessionCallbacks *callbacks, JMTextEncoding desiredEncoding, JMClientData data)
  150. ;
  151.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  152.         IMPORT_CFM_FUNCTION JMOpenSession
  153.     ENDIF
  154.  
  155. ;
  156. ; extern OSStatus JMCloseSession(JMSessionRef session)
  157. ;
  158.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  159.         IMPORT_CFM_FUNCTION JMCloseSession
  160.     ENDIF
  161.  
  162.  
  163. ; * Client data getter/setter functions.
  164.  
  165. ;
  166. ; extern OSStatus JMGetSessionData(JMSessionRef session, JMClientData *data)
  167. ;
  168.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  169.         IMPORT_CFM_FUNCTION JMGetSessionData
  170.     ENDIF
  171.  
  172. ;
  173. ; extern OSStatus JMSetSessionData(JMSessionRef session, JMClientData data)
  174. ;
  175.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  176.         IMPORT_CFM_FUNCTION JMSetSessionData
  177.     ENDIF
  178.  
  179.  
  180. ; * Prepend the target of the FSSpec to the class path.
  181. ; * If a file, .zip or other known archive file - not a .class file
  182.  
  183. ;
  184. ; extern OSStatus JMAddToClassPath(JMSessionRef session, const FSSpec *spec)
  185. ;
  186.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  187.         IMPORT_CFM_FUNCTION JMAddToClassPath
  188.     ENDIF
  189.  
  190.  
  191. ; * Utility returns (client owned) null terminated handle containing "file://xxxx", or nil if fnfErr
  192.  
  193. ;
  194. ; extern Handle JMFSSToURL(JMSessionRef session, const FSSpec *spec)
  195. ;
  196.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  197.         IMPORT_CFM_FUNCTION JMFSSToURL
  198.     ENDIF
  199.  
  200.  
  201. ; * Turns "file:///disk/file" into an FSSpec.  other handlers return paramErr
  202.  
  203. ;
  204. ; extern OSStatus JMURLToFSS(JMSessionRef session, JMTextRef urlString, FSSpec *spec)
  205. ;
  206.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  207.         IMPORT_CFM_FUNCTION JMURLToFSS
  208.     ENDIF
  209.  
  210.  
  211. ; * JMIdle gives time to all Java threads. Giving more time makes Java programs run faster,
  212. ; * but can reduce overall system responsiveness. JMIdle will return sooner if low-level (user)
  213. ; * events appear in the event queue.
  214.  
  215. ;
  216. ; extern OSStatus JMIdle(JMSessionRef session, UInt32 jmTimeMillis)
  217. ;
  218.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  219.         IMPORT_CFM_FUNCTION JMIdle
  220.     ENDIF
  221.  
  222.  
  223. ; * Java defines system-wide properties that applets can use to make queries about the
  224. ; * host system. Many of these properties correspond to defaults provided by "Internet Config."
  225. ; * JMPutSessionProperty can be used by a client program to modify various system-wide properties.
  226.  
  227. ;
  228. ; extern OSStatus JMGetSessionProperty(JMSessionRef session, JMTextRef propertyName, JMTextRef *propertyValue)
  229. ;
  230.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  231.         IMPORT_CFM_FUNCTION JMGetSessionProperty
  232.     ENDIF
  233.  
  234. ;
  235. ; extern OSStatus JMPutSessionProperty(JMSessionRef session, JMTextRef propertyName, JMTextRef propertyValue)
  236. ;
  237.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  238.         IMPORT_CFM_FUNCTION JMPutSessionProperty
  239.     ENDIF
  240.  
  241.  
  242. ; * JMText: opaque object that encapsulates a string, length, and
  243. ; * character encoding.  Strings passed between JManager and the
  244. ; * embedding application goes through this interface.  Only the most
  245. ; * rudimentary conversion routines are supplied - it is expected that
  246. ; * the embedding application will most of its work in the System Script.
  247. ; *
  248. ; * These APIs present some questions about who actually owns the 
  249. ; * JMText.  The rule is, if you created a JMTextRef, you are responsible
  250. ; * for deleting it after passing it into the runtime.  If the runtime passes
  251. ; * one to you, it will be deleted after the callback.
  252. ; *
  253. ; * If a pointer to an uninitialised JMTextRef is passed in to a routine (eg JMGetSessionProperty),
  254. ; * it is assumed to have been created for the caller, and it is the callers responsibility to
  255. ; * dispose of it.
  256. ; *
  257. ; * The encoding types are taken verbatim from the Text Encoding Converter,
  258. ; * which handles the ugly backside of script conversion.
  259.  
  260. ; * JMNewTextRef can create from a buffer of data in the specified encoding
  261.  
  262. ;
  263. ; extern OSStatus JMNewTextRef(JMSessionRef session, JMTextRef *textRef, JMTextEncoding encoding, const void *charBuffer, UInt32 bufferLengthInBytes)
  264. ;
  265.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  266.         IMPORT_CFM_FUNCTION JMNewTextRef
  267.     ENDIF
  268.  
  269.  
  270. ; * JMCopyTextRef clones a text ref.
  271.  
  272. ;
  273. ; extern OSStatus JMCopyTextRef(JMTextRef textRefSrc, JMTextRef *textRefDst)
  274. ;
  275.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  276.         IMPORT_CFM_FUNCTION JMCopyTextRef
  277.     ENDIF
  278.  
  279.  
  280. ; * Disposes of a text ref passed back from the runtime, or created explicitly through JMNewTextRef
  281.  
  282. ;
  283. ; extern OSStatus JMDisposeTextRef(JMTextRef textRef)
  284. ;
  285.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  286.         IMPORT_CFM_FUNCTION JMDisposeTextRef
  287.     ENDIF
  288.  
  289.  
  290. ; * Returns the text length, in characters
  291.  
  292. ;
  293. ; extern OSStatus JMGetTextLength(JMTextRef textRef, UInt32 *textLengthInCharacters)
  294. ;
  295.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  296.         IMPORT_CFM_FUNCTION JMGetTextLength
  297.     ENDIF
  298.  
  299.  
  300. ; * Returns the text length, in number of bytes taken in the destination encoding
  301.  
  302. ;
  303. ; extern OSStatus JMGetTextLengthInBytes(JMTextRef textRef, JMTextEncoding dstEncoding, UInt32 *textLengthInBytes)
  304. ;
  305.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  306.         IMPORT_CFM_FUNCTION JMGetTextLengthInBytes
  307.     ENDIF
  308.  
  309.  
  310. ; * Copies the specified number of characters to the destination buffer with the appropriate
  311. ; * destination encoding.
  312.  
  313. ;
  314. ; extern OSStatus JMGetTextBytes(JMTextRef textRef, JMTextEncoding dstEncoding, void *textBuffer, UInt32 textBufferLength, UInt32 *numCharsCopied)
  315. ;
  316.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  317.         IMPORT_CFM_FUNCTION JMGetTextBytes
  318.     ENDIF
  319.  
  320.  
  321. ; * Returns a Handle to a null terminated, "C" string in the System Script.
  322.  
  323. ;
  324. ; extern Handle JMTextToMacOSCStringHandle(JMTextRef textRef)
  325. ;
  326.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  327.         IMPORT_CFM_FUNCTION JMTextToMacOSCStringHandle
  328.     ENDIF
  329.  
  330.  
  331.  
  332.  
  333. ; * Proxy properties in the runtime.
  334. ; *
  335. ; * These will only be checked if InternetConfig isn't used to specify properties,
  336. ; * or if it doesn't have the data for these.
  337.  
  338. JMProxyInfo                RECORD 0
  339. useProxy                 ds.b    1                ; offset: $0 (0)
  340. proxyHost                 ds.b    255                ; offset: $1 (1)
  341. proxyPort                 ds.w    1                ; offset: $100 (256)
  342. sizeof                     EQU *                    ; size:   $102 (258)
  343.                         ENDR
  344.  
  345. ; typedef long                            JMProxyType
  346. eHTTPProxy                        EQU        0
  347. eFirewallProxy                    EQU        1
  348. eFTPProxy                        EQU        2
  349. ;
  350. ; extern OSStatus JMGetProxyInfo(JMSessionRef session, JMProxyType proxyType, JMProxyInfo *proxyInfo)
  351. ;
  352.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  353.         IMPORT_CFM_FUNCTION JMGetProxyInfo
  354.     ENDIF
  355.  
  356. ;
  357. ; extern OSStatus JMSetProxyInfo(JMSessionRef session, JMProxyType proxyType, const JMProxyInfo *proxyInfo)
  358. ;
  359.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  360.         IMPORT_CFM_FUNCTION JMSetProxyInfo
  361.     ENDIF
  362.  
  363.  
  364. ; * Security - JManager 2.0 security is handled on a per-applet basis.
  365. ; * There are some security settings that are inherited from InternetConfig
  366. ; * (Proxy Servers) but the verifier can now be enabled and disabled.
  367.  
  368. ;
  369. ; extern OSStatus JMGetVerifyMode(JMSessionRef session, JMVerifierOptions *verifierOptions)
  370. ;
  371.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  372.         IMPORT_CFM_FUNCTION JMGetVerifyMode
  373.     ENDIF
  374.  
  375. ;
  376. ; extern OSStatus JMSetVerifyMode(JMSessionRef session, JMVerifierOptions verifierOptions)
  377. ;
  378.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  379.         IMPORT_CFM_FUNCTION JMSetVerifyMode
  380.     ENDIF
  381.  
  382.  
  383.  
  384.  
  385. ; * The basic unit of AWT interaction is the JMFrame.  A JMFrame is bound to top level
  386. ; * awt Frame, Window, or Dialog.  When a user event occurs for a MacOS window, the event is passed
  387. ; * to the corrosponding frame object.  Similarly, when an AWT event occurs that requires the
  388. ; * Mac OS Window to change, a callback is made.  JManager 1.x bound the frame to the window through
  389. ; * a callback to set and restore the windows GrafPort.  In JManager 2.0, a GrafPort, Offset, and 
  390. ; * ClipRgn are specified up front - changes in visibility and structure require that these be re-set.
  391. ; * This enables support for the JavaSoft DrawingSurface API - and also improves graphics performance.
  392. ; * You should reset the graphics attributes anytime the visiblity changes, like when scrolling.
  393. ; * You should also set it initially when the AWTContext requests the frame.
  394. ; * At various times, JM will call back to the client to register a new JMFrame, 
  395. ; * indicating the frame type.  The client should take the following steps:
  396. ; *
  397. ; *    o    Create a new invisible window of the specified type
  398. ; *    o    Fill in the callbacks parameter with function pointers
  399. ; *    o    Do something to bind the frame to the window (like stuff the WindowPtr in the JMClientData of the frame)
  400. ; *    o    Register the visiblity parameters (GrafPtr, etc) with the frame
  401.  
  402.  
  403. ; typedef long                            ReorderRequest
  404. eBringToFront                    EQU        0                    ; bring the window to front 
  405. eSendToBack                        EQU        1                    ; send the window to back 
  406. eSendBehindFront                EQU        2                    ; send the window behind the front window 
  407. JMFrameCallbacks        RECORD 0
  408. fVersion                 ds.l    1                ; offset: $0 (0)        ;  should be set to kJMVersion 
  409. fSetFrameSize             ds.l    1                ; offset: $4 (4)
  410. fInvalRect                 ds.l    1                ; offset: $8 (8)
  411. fShowHide                 ds.l    1                ; offset: $C (12)
  412. fSetTitle                 ds.l    1                ; offset: $10 (16)
  413. fCheckUpdate             ds.l    1                ; offset: $14 (20)
  414. fReorderFrame             ds.l    1                ; offset: $18 (24)
  415. fSetResizeable             ds.l    1                ; offset: $1C (28)
  416. sizeof                     EQU *                    ; size:   $20 (32)
  417.                         ENDR
  418. ;
  419. ; extern OSStatus JMSetFrameVisibility(JMFrameRef frame, GrafPtr famePort, Point frameOrigin, RgnHandle frameClip)
  420. ;
  421.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  422.         IMPORT_CFM_FUNCTION JMSetFrameVisibility
  423.     ENDIF
  424.  
  425. ;
  426. ; extern OSStatus JMGetFrameData(JMFrameRef frame, JMClientData *data)
  427. ;
  428.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  429.         IMPORT_CFM_FUNCTION JMGetFrameData
  430.     ENDIF
  431.  
  432. ;
  433. ; extern OSStatus JMSetFrameData(JMFrameRef frame, JMClientData data)
  434. ;
  435.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  436.         IMPORT_CFM_FUNCTION JMSetFrameData
  437.     ENDIF
  438.  
  439. ;
  440. ; extern OSStatus JMGetFrameSize(JMFrameRef frame, Rect *result)
  441. ;
  442.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  443.         IMPORT_CFM_FUNCTION JMGetFrameSize
  444.     ENDIF
  445.  
  446. ;  note that the top left indicates the "global" position of this frame 
  447. ;  use this to update the frame position when it gets moved 
  448. ;
  449. ; extern OSStatus JMSetFrameSize(JMFrameRef frame, const Rect *newSize)
  450. ;
  451.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  452.         IMPORT_CFM_FUNCTION JMSetFrameSize
  453.     ENDIF
  454.  
  455. ; * Dispatch a particular event to an embedded frame
  456.  
  457. ;
  458. ; extern OSStatus JMFrameClick(JMFrameRef frame, Point localPos, short modifiers)
  459. ;
  460.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  461.         IMPORT_CFM_FUNCTION JMFrameClick
  462.     ENDIF
  463.  
  464. ;
  465. ; extern OSStatus JMFrameKey(JMFrameRef frame, char asciiChar, char keyCode, short modifiers)
  466. ;
  467.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  468.         IMPORT_CFM_FUNCTION JMFrameKey
  469.     ENDIF
  470.  
  471. ;
  472. ; extern OSStatus JMFrameKeyRelease(JMFrameRef frame, char asciiChar, char keyCode, short modifiers)
  473. ;
  474.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  475.         IMPORT_CFM_FUNCTION JMFrameKeyRelease
  476.     ENDIF
  477.  
  478. ;
  479. ; extern OSStatus JMFrameUpdate(JMFrameRef frame, RgnHandle updateRgn)
  480. ;
  481.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  482.         IMPORT_CFM_FUNCTION JMFrameUpdate
  483.     ENDIF
  484.  
  485. ;
  486. ; extern OSStatus JMFrameActivate(JMFrameRef frame, Boolean activate)
  487. ;
  488.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  489.         IMPORT_CFM_FUNCTION JMFrameActivate
  490.     ENDIF
  491.  
  492. ;
  493. ; extern OSStatus JMFrameResume(JMFrameRef frame, Boolean resume)
  494. ;
  495.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  496.         IMPORT_CFM_FUNCTION JMFrameResume
  497.     ENDIF
  498.  
  499. ;
  500. ; extern OSStatus JMFrameMouseOver(JMFrameRef frame, Point localPos, short modifiers)
  501. ;
  502.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  503.         IMPORT_CFM_FUNCTION JMFrameMouseOver
  504.     ENDIF
  505.  
  506. ;
  507. ; extern OSStatus JMFrameShowHide(JMFrameRef frame, Boolean showFrame)
  508. ;
  509.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  510.         IMPORT_CFM_FUNCTION JMFrameShowHide
  511.     ENDIF
  512.  
  513. ;
  514. ; extern OSStatus JMFrameGoAway(JMFrameRef frame)
  515. ;
  516.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  517.         IMPORT_CFM_FUNCTION JMFrameGoAway
  518.     ENDIF
  519.  
  520. ;
  521. ; extern JMAWTContextRef JMGetFrameContext(JMFrameRef frame)
  522. ;
  523.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  524.         IMPORT_CFM_FUNCTION JMGetFrameContext
  525.     ENDIF
  526.  
  527. ;
  528. ; extern OSStatus JMFrameDragTracking(JMFrameRef frame, DragTrackingMessage message, DragReference theDragRef)
  529. ;
  530.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  531.         IMPORT_CFM_FUNCTION JMFrameDragTracking
  532.     ENDIF
  533.  
  534. ;
  535. ; extern OSStatus JMFrameDragReceive(JMFrameRef frame, DragReference theDragRef)
  536. ;
  537.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  538.         IMPORT_CFM_FUNCTION JMFrameDragReceive
  539.     ENDIF
  540.  
  541. ; * Window types
  542.  
  543.  
  544. ; typedef long                            JMFrameKind
  545. eBorderlessModelessWindowFrame    EQU        0
  546. eModelessWindowFrame            EQU        1
  547. eModalWindowFrame                EQU        2
  548. eModelessDialogFrame            EQU        3
  549.  
  550.  
  551.  
  552. ;  JMAWTContext -
  553. ; * To create a top level frame, you must use a JMAWTContext object.
  554. ; * The JMAWTContext provides a context for the AWT to request frames.
  555. ; * A AWTContext has a threadgroup associated with it - all events and processing occurs
  556. ; * there.  When you create one, it is quiescent, you must call resume before it begins executing.
  557.  
  558. JMAWTContextCallbacks    RECORD 0
  559. fVersion                 ds.l    1                ; offset: $0 (0)        ;  should be set to kJMVersion 
  560. fRequestFrame             ds.l    1                ; offset: $4 (4)        ;  a new frame is being created. 
  561. fReleaseFrame             ds.l    1                ; offset: $8 (8)        ;  an existing frame is being destroyed. 
  562. fUniqueMenuID             ds.l    1                ; offset: $C (12)        ;  a new menu will be created with this id. 
  563. fExceptionOccurred         ds.l    1                ; offset: $10 (16)        ;  just some notification that some recent operation caused an exception.  You can't do anything really from here. 
  564. sizeof                     EQU *                    ; size:   $14 (20)
  565.                         ENDR
  566. ;
  567. ; extern OSStatus JMNewAWTContext(JMAWTContextRef *context, JMSessionRef session, const JMAWTContextCallbacks *callbacks, JMClientData data)
  568. ;
  569.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  570.         IMPORT_CFM_FUNCTION JMNewAWTContext
  571.     ENDIF
  572.  
  573. ;
  574. ; extern OSStatus JMDisposeAWTContext(JMAWTContextRef context)
  575. ;
  576.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  577.         IMPORT_CFM_FUNCTION JMDisposeAWTContext
  578.     ENDIF
  579.  
  580. ;
  581. ; extern OSStatus JMGetAWTContextData(JMAWTContextRef context, JMClientData *data)
  582. ;
  583.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  584.         IMPORT_CFM_FUNCTION JMGetAWTContextData
  585.     ENDIF
  586.  
  587. ;
  588. ; extern OSStatus JMSetAWTContextData(JMAWTContextRef context, JMClientData data)
  589. ;
  590.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  591.         IMPORT_CFM_FUNCTION JMSetAWTContextData
  592.     ENDIF
  593.  
  594. ;
  595. ; extern OSStatus JMCountAWTContextFrames(JMAWTContextRef context, UInt32 *frameCount)
  596. ;
  597.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  598.         IMPORT_CFM_FUNCTION JMCountAWTContextFrames
  599.     ENDIF
  600.  
  601. ;
  602. ; extern OSStatus JMGetAWTContextFrame(JMAWTContextRef context, UInt32 frameIndex, JMFrameRef *frame)
  603. ;
  604.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  605.         IMPORT_CFM_FUNCTION JMGetAWTContextFrame
  606.     ENDIF
  607.  
  608. ;
  609. ; extern OSStatus JMMenuSelected(JMAWTContextRef context, MenuHandle hMenu, short menuItem)
  610. ;
  611.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  612.         IMPORT_CFM_FUNCTION JMMenuSelected
  613.     ENDIF
  614.  
  615.  
  616.  
  617.  
  618. ; * JMAppletLocator - Since Java applets are always referenced by a Uniform Resource Locator
  619. ; * (see RFC 1737, http://www.w3.org/pub/WWW/Addressing/rfc1738.txt), we provide an object
  620. ; * that encapsulates the information about a set of applets. A JMAppletLocator is built
  621. ; * by providing a base URL, which must point at a valid HTML document containing applet
  622. ; * tags. To save a network transaction, the contents of the document may be passed optionally. 
  623. ; *
  624. ; * You can also use a JMLocatorInfoBlock for a synchronous resolution of the applet,
  625. ; * assuming that you already have the info for the tag.
  626.  
  627.  
  628. ; typedef long                            JMLocatorErrors
  629. eLocatorNoErr                    EQU        0                    ; the html was retrieved successfully
  630. eHostNotFound                    EQU        1                    ; the host specified by the url could not be found
  631. eFileNotFound                    EQU        2                    ; the file could not be found on the host
  632. eLocatorTimeout                    EQU        3                    ; a timeout occurred retrieving the html text
  633. eLocatorKilled                    EQU        4                    ; in response to a JMDisposeAppletLocator before it has completed
  634. JMAppletLocatorCallbacks RECORD 0
  635. fVersion                 ds.l    1                ; offset: $0 (0)        ;  should be set to kJMVersion 
  636. fCompleted                 ds.l    1                ; offset: $4 (4)        ;  called when the html has been completely fetched 
  637. sizeof                     EQU *                    ; size:   $8 (8)
  638.                         ENDR
  639. ; * These structures are used to pass pre-parsed parameter
  640. ; * tags to the AppletLocator.  Implies synchronous semantics.
  641.  
  642.  
  643. JMLIBOptionalParams        RECORD 0
  644. fParamName                 ds.l    1                ; offset: $0 (0)        ;  could be from a <parameter name=foo value=bar> or "zipbase", etc 
  645. fParamValue                 ds.l    1                ; offset: $4 (4)        ;  the value of this optional tag 
  646. sizeof                     EQU *                    ; size:   $8 (8)
  647.                         ENDR
  648. JMLocatorInfoBlock        RECORD 0
  649. fVersion                 ds.l    1                ; offset: $0 (0)        ;  should be set to kJMVersion 
  650. ;  These are required to be present and not nil 
  651. fBaseURL                 ds.l    1                ; offset: $4 (4)        ;  the URL of this applet's host page 
  652. fAppletCode                 ds.l    1                ; offset: $8 (8)        ;  code= parameter 
  653. fWidth                     ds.w    1                ; offset: $C (12)        ;  width= parameter 
  654. fHeight                     ds.w    1                ; offset: $E (14)        ;  height= parameter 
  655. ;  These are optional parameters 
  656. fOptionalParameterCount     ds.l    1                ; offset: $10 (16)        ;  how many in this array 
  657. fParams                     ds.l    1                ; offset: $14 (20)        ;  pointer to an array of these (points to first element) 
  658. sizeof                     EQU *                    ; size:   $18 (24)
  659.                         ENDR
  660. ;
  661. ; extern OSStatus JMNewAppletLocator(JMAppletLocatorRef *locatorRef, JMSessionRef session, const JMAppletLocatorCallbacks *callbacks, JMTextRef url, JMTextRef htmlText, JMClientData data)
  662. ;
  663.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  664.         IMPORT_CFM_FUNCTION JMNewAppletLocator
  665.     ENDIF
  666.  
  667. ;
  668. ; extern OSStatus JMNewAppletLocatorFromInfo(JMAppletLocatorRef *locatorRef, JMSessionRef session, const JMLocatorInfoBlock *info, JMClientData data)
  669. ;
  670.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  671.         IMPORT_CFM_FUNCTION JMNewAppletLocatorFromInfo
  672.     ENDIF
  673.  
  674. ;
  675. ; extern OSStatus JMDisposeAppletLocator(JMAppletLocatorRef locatorRef)
  676. ;
  677.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  678.         IMPORT_CFM_FUNCTION JMDisposeAppletLocator
  679.     ENDIF
  680.  
  681. ;
  682. ; extern OSStatus JMGetAppletLocatorData(JMAppletLocatorRef locatorRef, JMClientData *data)
  683. ;
  684.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  685.         IMPORT_CFM_FUNCTION JMGetAppletLocatorData
  686.     ENDIF
  687.  
  688. ;
  689. ; extern OSStatus JMSetAppletLocatorData(JMAppletLocatorRef locatorRef, JMClientData data)
  690. ;
  691.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  692.         IMPORT_CFM_FUNCTION JMSetAppletLocatorData
  693.     ENDIF
  694.  
  695. ;
  696. ; extern OSStatus JMCountApplets(JMAppletLocatorRef locatorRef, UInt32 *appletCount)
  697. ;
  698.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  699.         IMPORT_CFM_FUNCTION JMCountApplets
  700.     ENDIF
  701.  
  702. ;
  703. ; extern OSStatus JMGetAppletDimensions(JMAppletLocatorRef locatorRef, UInt32 appletIndex, UInt32 *width, UInt32 *height)
  704. ;
  705.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  706.         IMPORT_CFM_FUNCTION JMGetAppletDimensions
  707.     ENDIF
  708.  
  709. ;
  710. ; extern OSStatus JMGetAppletTag(JMAppletLocatorRef locatorRef, UInt32 appletIndex, JMTextRef *tagRef)
  711. ;
  712.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  713.         IMPORT_CFM_FUNCTION JMGetAppletTag
  714.     ENDIF
  715.  
  716. ;
  717. ; extern OSStatus JMGetAppletName(JMAppletLocatorRef locatorRef, UInt32 appletIndex, JMTextRef *nameRef)
  718. ;
  719.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  720.         IMPORT_CFM_FUNCTION JMGetAppletName
  721.     ENDIF
  722.  
  723.  
  724. ; * JMAppletViewer - Applets are instantiated, one by one, by specifying a JMAppletLocator and
  725. ; * a zero-based index (Macintosh API's usually use one-based indexing, the Java language
  726. ; * uses zero, however.). The resulting applet is encapsulated in a JMAppletViewer object. 
  727. ; * Since applets can have one or more visible areas to draw in, one or more JMFrame objects
  728. ; * may be requested while the viewer is being created, or at a later time, thus the client
  729. ; * must provide callbacks to satisfy these requests.
  730. ; *
  731. ; * The window name for the ShowDocument callback is one of:
  732. ; *   _self        show in current frame
  733. ; *   _parent    show in parent frame
  734. ; *   _top        show in top-most frame
  735. ; *   _blank        show in new unnamed top-level window
  736. ; *   <other>    show in new top-level window named <other> 
  737.  
  738. JMAppletViewerCallbacks    RECORD 0
  739. fVersion                 ds.l    1                ; offset: $0 (0)        ;  should be set to kJMVersion 
  740. fShowDocument             ds.l    1                ; offset: $4 (4)        ;  go to a url, optionally in a new window 
  741. fSetStatusMsg             ds.l    1                ; offset: $8 (8)        ;  applet changed status message 
  742. sizeof                     EQU *                    ; size:   $C (12)
  743.                         ENDR
  744. ; * NEW: per-applet security settings
  745. ; * Previously, these settings were attached to the session.
  746. ; * JManager 2.0 allows them to be attached to each viewer.
  747.  
  748.  
  749. ; typedef long                            JMNetworkSecurityOptions
  750. eNoNetworkAccess                EQU        0
  751. eAppletHostAccess                EQU        1
  752. eUnrestrictedAccess                EQU        2
  753.  
  754. ; typedef long                            JMFileSystemOptions
  755. eNoFSAccess                        EQU        0
  756. eLocalAppletAccess                EQU        1
  757. eAllFSAccess                    EQU        2
  758. ; * Lists of packages are comma separated,
  759. ; * the default for mrj.security.system.access is
  760. ; * "sun,netscape,com.apple".
  761.  
  762.  
  763. JMAppletSecurity        RECORD 0
  764. fVersion                 ds.l    1                ; offset: $0 (0)        ;  should be set to kJMVersion 
  765. fNetworkSecurity         ds.l    1                ; offset: $4 (4)        ;  can this applet access network resources 
  766. fFileSystemSecurity         ds.l    1                ; offset: $8 (8)        ;  can this applet access network resources 
  767. fRestrictSystemAccess     ds.b    1                ; offset: $C (12)        ;  restrict access to system packages (com.apple.*, sun.*, netscape.*) also found in the property "mrj.security.system.access" 
  768. fRestrictSystemDefine     ds.b    1                ; offset: $D (13)        ;  restrict classes from loading system packages (com.apple.*, sun.*, netscape.*) also found in the property "mrj.security.system.define" 
  769. fRestrictApplicationAccess  ds.b 1                ; offset: $E (14)        ;  restrict access to application packages found in the property "mrj.security.application.access" 
  770. fRestrictApplicationDefine  ds.b 1                ; offset: $F (15)        ;  restrict access to application packages found in the property "mrj.security.application.access" 
  771. sizeof                     EQU *                    ; size:   $10 (16)
  772.                         ENDR
  773. ; * AppletViewer methods
  774.  
  775. ;
  776. ; extern OSStatus JMNewAppletViewer(JMAppletViewerRef *viewer, JMAWTContextRef context, JMAppletLocatorRef locatorRef, UInt32 appletIndex, const JMAppletSecurity *security, const JMAppletViewerCallbacks *callbacks, JMClientData data)
  777. ;
  778.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  779.         IMPORT_CFM_FUNCTION JMNewAppletViewer
  780.     ENDIF
  781.  
  782. ;
  783. ; extern OSStatus JMDisposeAppletViewer(JMAppletViewerRef viewer)
  784. ;
  785.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  786.         IMPORT_CFM_FUNCTION JMDisposeAppletViewer
  787.     ENDIF
  788.  
  789. ;
  790. ; extern OSStatus JMGetAppletViewerData(JMAppletViewerRef viewer, JMClientData *data)
  791. ;
  792.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  793.         IMPORT_CFM_FUNCTION JMGetAppletViewerData
  794.     ENDIF
  795.  
  796. ;
  797. ; extern OSStatus JMSetAppletViewerData(JMAppletViewerRef viewer, JMClientData data)
  798. ;
  799.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  800.         IMPORT_CFM_FUNCTION JMSetAppletViewerData
  801.     ENDIF
  802.  
  803.  
  804. ; * You can change the applet security on the fly
  805.  
  806. ;
  807. ; extern OSStatus JMGetAppletViewerSecurity(JMAppletViewerRef viewer, JMAppletSecurity *data)
  808. ;
  809.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  810.         IMPORT_CFM_FUNCTION JMGetAppletViewerSecurity
  811.     ENDIF
  812.  
  813. ;
  814. ; extern OSStatus JMSetAppletViewerSecurity(JMAppletViewerRef viewer, const JMAppletSecurity *data)
  815. ;
  816.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  817.         IMPORT_CFM_FUNCTION JMSetAppletViewerSecurity
  818.     ENDIF
  819.  
  820.  
  821. ; * JMReloadApplet reloads viewer's applet from the source.
  822. ; * JMRestartApplet reinstantiates the applet without reloading.
  823.  
  824. ;
  825. ; extern OSStatus JMReloadApplet(JMAppletViewerRef viewer)
  826. ;
  827.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  828.         IMPORT_CFM_FUNCTION JMReloadApplet
  829.     ENDIF
  830.  
  831. ;
  832. ; extern OSStatus JMRestartApplet(JMAppletViewerRef viewer)
  833. ;
  834.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  835.         IMPORT_CFM_FUNCTION JMRestartApplet
  836.     ENDIF
  837.  
  838.  
  839. ; * JMSuspendApplet tells the Java thread scheduler to stop executing the viewer's applet.
  840. ; * JMResumeApplet resumes execution of the viewer's applet.
  841.  
  842. ;
  843. ; extern OSStatus JMSuspendApplet(JMAppletViewerRef viewer)
  844. ;
  845.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  846.         IMPORT_CFM_FUNCTION JMSuspendApplet
  847.     ENDIF
  848.  
  849. ;
  850. ; extern OSStatus JMResumeApplet(JMAppletViewerRef viewer)
  851. ;
  852.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  853.         IMPORT_CFM_FUNCTION JMResumeApplet
  854.     ENDIF
  855.  
  856.  
  857. ;  
  858. ; * To get back to the JMAppletViewerRef instance from whence a frame came,
  859. ; * as well as the ultimate frame parent (the one created _for_ the applet viewer)
  860.  
  861. ;
  862. ; extern OSStatus JMGetFrameViewer(JMFrameRef frame, JMAppletViewerRef *viewer, JMFrameRef *parentFrame)
  863. ;
  864.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  865.         IMPORT_CFM_FUNCTION JMGetFrameViewer
  866.     ENDIF
  867.  
  868. ; * To get a ref back to the Frame that was created for this JMAppletViewerRef
  869.  
  870. ;
  871. ; extern OSStatus JMGetViewerFrame(JMAppletViewerRef viewer, JMFrameRef *frame)
  872. ;
  873.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  874.         IMPORT_CFM_FUNCTION JMGetViewerFrame
  875.     ENDIF
  876.  
  877.     ENDIF ; __JMANAGER__ 
  878.  
  879.